home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / haeberli / libgutil / brect.c < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  79 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*
  18.  *    brect -
  19.  *        Support for drawing beveled rectangles.
  20.  *
  21.  *    exports
  22.  *
  23.     void bulbous_rectfi(x1, y1, x2, y2)
  24.  *
  25.  */
  26. #include "gl.h"
  27.  
  28. void bulbous_rectfi(x1, y1, x2, y2)
  29. {
  30.     short ri, gi, bi;
  31.     float r, g, b, h, s, v;
  32.  
  33.     getmcolor(getcolor(), &ri, &gi, &bi);
  34.     irgb_to_rgb(ri, gi, bi, &r, &g, &b);
  35.     rgb_to_hsv(r, g, b, &h, &s, &v);
  36.  
  37.     color(hsv(h, s, .72));
  38.     rectfi(x1, y1, x2, y2);
  39.  
  40.     color(hsv(h, s, 0));
  41.     move2i(x1, y1);
  42.     draw2i(x2, y1);
  43.     draw2i(x2, y2);
  44.     draw2i(x1, y2);
  45.     draw2i(x1, y1);
  46.  
  47.     color(hsv(h, s, 1));
  48.     move2i(x1+1, y2-1);
  49.     draw2i(x2-1, y2-1);
  50.  
  51.     color(hsv(h, s, .94));
  52.     move2i(x1+1, y1+2);
  53.     draw2i(x1+1, y2-2);
  54.     move2i(x2-1, y1+2);
  55.     draw2i(x2-1, y2-2);
  56.  
  57.     color(hsv(h, s, .9));
  58.     move2i(x1+2, y2-2);
  59.     draw2i(x2-2, y2-2);
  60.  
  61.     color(hsv(h, s, .84));
  62.     move2i(x1+2, y1+3);
  63.     draw2i(x1+2, y2-3);
  64.     draw2i(x2-2, y2-3);
  65.     draw2i(x2-2, y1+3);
  66.  
  67.     color(hsv(h, s, .68));
  68.     move2i(x1+4, y1+3);
  69.     draw2i(x2-4, y1+3);
  70.  
  71.     color(hsv(h, s, .56));
  72.     move2i(x1+3, y1+2);
  73.     draw2i(x2-3, y1+2);
  74.  
  75.     color(hsv(h, s, .44));
  76.     move2i(x1+2, y1+1);
  77.     draw2i(x2-2, y1+1);
  78. }
  79.